<template>
    <div class="container" @click="handleClickClose">
        <div class="wrap">
            <swiper :options="swiperOption">
                <!-- slides -->
                <swiper-slide v-for="(item, index) in list" :key="index">
                    <img class="img" :src="item" alt="">
                </swiper-slide>
                <!-- Optional controls -->
                <div class="swiper-pagination"  slot="pagination"></div>
        </swiper>
        </div>
    </div>
</template>

<script>
export default {
  name: 'Gallary',
  props: {
    list: {
      type: Array,
      default () {
        return ['http://img1.qunarzz.com/sight/p0/1609/64/6427cd81acd2a232a3.img.jpg_r_800x800_cdb856bc.jpg']
      }
    }
  },
  data () {
    return {
      swiperOption: {
        pagination: '.swiper-pagination',
        paginationType: 'fraction',
        observer: true,
        observeParents: true
      }
    }
  },
  methods: {
    handleClickClose () {
      this.$emit('handleClose')
    }
  }
}
</script>

<style lang="stylus" scoped>
.container >>> .swiper-container
    overflow inherit
.container
    z-index 99
    display flex
    flex-direction column
    justify-content center
    position fixed
    top 0
    left 0
    right 0
    bottom 0
    background-color #000
    color #fff
    .wrap
        width 100%
        height 0
        padding-bottom 100%
        .img
            width 100%
        .swiper-pagination
            bottom -1.2rem
            color #fff
</style>
